import psycopg2
import pandas as pd

# postgres config
postgres_host = "172.16.137.39"
postgres_port = "5432"
postgres_user = "a2513220218"
postgres_password = "xawl-6043"
postgres_database = "a2513220218"
postgres_table1 = "S-T"

# connection string
conn_string = "host=" + postgres_host + " port=" + postgres_port + " dbname=" + postgres_database + " user=" + postgres_user + " password=" + postgres_password

conn = psycopg2.connect(conn_string)
cursor = conn.cursor()
sql_command1 = "SELECT sno,sname,sdept FROM \"S-T\".student" 
data1 = pd.read_sql(sql_command1, conn)
print(data1)